package com.ldatum.crm.serviceImpl;

import java.util.List;

import com.ldatum.crm.dao.SupplierDao;
import com.ldatum.crm.daoImpl.SupplierDaoImpl;
import com.ldatum.crm.domain.Supplier;
import com.ldatum.crm.service.SupplierService;

public class SupplierServiceImpl implements SupplierService {
	
	SupplierDao supplierDao = new SupplierDaoImpl();
	
	@Override
	public int save(Supplier supplier) throws Exception {
		return supplierDao.save(supplier);
	}

	@Override
	public List<Supplier> list() throws Exception {
		return supplierDao.list();
	}

	@Override
	public Supplier findById(int id) throws Exception {
		return supplierDao.findById(id);
	}

	@Override
	public int delete(String ids) throws Exception {
		ids = ids.substring(0, ids.length()-1);
		return supplierDao.deletes(ids);
		
	}

	@Override
	public int update(Supplier supplier) throws Exception {
		return supplierDao.update(supplier);
	}

	@Override
	public int findTodaySuppliers() throws Exception {
		return supplierDao.findTodaySuppliers();
	}

}
